package com.lcm.oj.lanqiao.year2021.moni.c1;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

/**
 * @author Coder-lcm
 * @date 2021/4/17
 */
public class T8 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int len = str.length();
        int t = Integer.parseInt(scanner.nextLine());
        char[] cs = str.toCharArray();
        Char[] chars = new Char[len];
        for (int i = 0; i < cs.length; i++) {
            chars[i] = new Char(cs[i], i);
        }
        Arrays.sort(chars, (Char o1, Char o2) ->{
                return o1.c - o2.c;
            }
        );

        for (Char aChar : chars) {
            System.out.println(aChar);
        }
    }
}
class Char{
    char c;
    int index;

    public Char(char c, int index) {
        this.c = c;
        this.index = index;
    }

    @Override
    public String toString() {
        return "Char{" +
                "c=" + c +
                ", index=" + index +
                '}';
    }
}
